package com.ridbor001.demo.service;

import com.ridbor001.demo.bean.RDBAdmin;
import com.ridbor001.demo.dao.RDBAdminDAO;

import java.sql.SQLException;
import java.util.Optional;

public class RDBAdminService {
    RDBAdminDAO dao = new RDBAdminDAO();
    public RDBAdmin findAdminById(String AdminId) throws SQLException {
        return dao.findAdminById(AdminId);
    }

    public Optional<RDBAdmin> findAdminByIdAndPassword(String id, String password) throws SQLException {
        return dao.findAdminByIdAndPassword(id, password);
    }

    public boolean AdminExists(String AdminId) throws SQLException {
        return dao.AdminExists(AdminId);
    }

    public void addAdmin(RDBAdmin user) throws SQLException {
        dao.addAdmin(user);
    }
}
